<template>
  <div
    class="header"
    :style="{
      backgroundImage: `url(${sellerInfo.avatar})`,
    }"
  >
    <!-- 毛玻璃遮罩层 -->
    <div class="mask"></div>
    <!-- 商家头部信息 -->
    <div class="info">
      <div class="pic">
        <img :src="sellerInfo.avatar" alt="商家logo" />
      </div>
      <div class="title">
        <p><span class="sp1">品牌</span>{{ sellerInfo.name }}</p>
        <p class="p2">{{sellerInfo.description}}/{{sellerInfo.deliveryTime}}分钟送达</p>
        <p>
          <span class="sp3">减</span>
          <span class="sp4">在线支付满28减5</span>
        </p>
        
        <!-- {{sellerInfo.supports[0].description}} -->
      </div>
     
    </div>
    <div class="count">5个 ></div>
    <div class="tips">
      <p>
        {{ sellerInfo.bulletin }}
      </p>
    </div>
  </div>
</template>

<script>

import { mapActions, mapState } from "vuex";
export default {
  data() {
    return {};
  },
  created() {
    //获取头部数据
    this.getSeller();
  },
  computed: {
    ...mapState(["sellerInfo"]),
  },
  methods: {
    ...mapActions(["getSeller"]),
  },
};
</script>

<style lang="less" scoped>
.header {

  width: 400px;
  height: 160px;
  margin: 0 auto;
  background: #333;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  
  .mask {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    height: 100%;
    background-color: rgba(7, 17, 27, 0.5);
    backdrop-filter: blur(10px);
  }
  .count{
    width: 45px;
    height: 24px;
    position: absolute;
    right: 5px;
    bottom: 50px;
    font-size: 10px;
    color: rgba(255, 255, 255,0.8);
    line-height: 23px;
    text-align: center;
    border-radius: 10px;
    background-color: rgba(0, 0, 0,0.2);
   }
  .info {
    position: absolute;
    width: 100%;
    height: 75px;
    left: 24px;
    top: 24px;
    display: flex;
    .pic {
      width: 75px;
      height: 85px;
      border-radius: 5px;
      overflow: hidden;
      margin-right: 10px;
      background-color: red;
      img {
        width: 75px;
        height: 85px;
      }
    }
    
    .title p:nth-of-type(1){
      font-size: 16px;
      line-height: 16px;
      color: white;
      font-weight: 500;
      line-height: 1;
      margin: 0;
      margin-top: 5px;
      margin-bottom: 15px;
    }
    .title .sp1{
    font-size: 13px;
    line-height: 1;
    color: white;
    background-color: red;
    padding: 2px;
    margin-right: 5px;
  }
 
  .title .p2{
    font-size: 13px;
    line-height: 1;
    margin: 0;
    margin-bottom: 10px;
    color: rgb(170, 169, 169);
    
  }
  .title p:nth-of-type(3){
    margin: 0;
  }
  .title .sp3{
    font-size: 14px;
    line-height: 1;
    color: red;
    padding: 2px;
    background-color: aliceblue;
    margin-right: 3px;
  }
  .title .sp4{
    font-size: 13px;
    line-height: 1;
    color: rgb(170, 169, 169);
  }
   
  }
  
  .tips {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35px;
    padding: 0;
    font-size: 10px;
    color: #fff;
    padding-left: 12px;
    background: rgba(7, 17, 27, 0.2);

    p {
      height: 20px;
      line-height: 20px;
      width: 85%;
      color: rgb(170, 169, 169);
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      &::before {
        content: "公告";
        color: black;
        background-color: #fff;
        padding: 3px;
        font-weight: 800;
        margin-right: 5px;
      }
      
    }
    &::after {
        content: ">";
        position: absolute;
        right: 25px;
        bottom: 4px;
        color: rgb(170, 169, 169);
        padding-left: 3px;
        margin-right: 5px;
        // background-color: red;
      }
  }
}
</style>
